package mediadisplay 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	import mediadisplay.timeline.TimelineContent;
	import mediadisplay.viewerarea.ScreenText;
	/**
	 * ...
	 * @author ...
	 */
	public class MediaArea extends Sprite
	{
		
		//private var _main:Main;
		private var tf:TextField;
		private var textformat:TextFormat;
		private var _content:TimelineContent;
		private var _rowID:int;
		
		public function MediaArea(rowID:int, content:TimelineContent) 
		{
			_rowID = rowID;
			_content = content;
			//_main = main;
			
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			graphics.beginFill(0x333333);
			graphics.drawRect(0, 0, stage.stageWidth, 20);
			graphics.endFill();
			y = 190 + (_rowID * 50);
			
			textformat = new TextFormat();
			textformat.color = 0xffffff;
			textformat.size = 16;
			
			tf = new TextField();
			addChild(tf);
			tf.x = 10;
			tf.y = 0;
			tf.defaultTextFormat = textformat;
			tf.autoSize = TextFieldAutoSize.LEFT;
			
			setText("");
		}
		public function setText(txt:String):void {
			if (ScreenText.HEY_IM_WORKING_HERE) return;
			tf.text = txt;
		}
	}

}